#Maintainer: Xyne <gro xunilhcra enyx, backwards>
pkgname=reflector
pkgver=2021.11
pkgrel=7
pkgdesc='A Python 3 module and script to retrieve and filter the latest Pacman mirror list.'
arch=(any)
license=(GPL2)
url="https://xyne.dev/projects/reflector"
depends=(python)
makedepends=(python-build python-installer python-setuptools python-wheel)
optdepends=('rsync: rate rsync mirrors')
backup=(etc/xdg/reflector/reflector.conf)
source=(https://xyne.dev/projects/reflector/src/reflector-2021.11.tar.xz{,.sig})
sha512sums=('8b7f3cebce9d1f18ecda55d3fe3440eaca51733826c764b2f6ee52edc1e8a31a4b4ae3aa415688c975425888eb30ff8791c8525a629928b064502ddbde93da3e'
            'SKIP')
b2sums=('464bd1cb213a04f1d39af85a1ddc03c3918db12e2c0c01499535245f937184cdc31d51b5ad62b74b66017f08b6e1b6bebcbadd98cdf3c8b23a72b98be885277c'
        'SKIP')
validpgpkeys=('D89FAAEB4CECAFD199A2F5E612C6F735F7A9A519')

build() {
  cd $pkgname-$pkgver
  python -m build --wheel --no-isolation
}

package ()
{
  cd $pkgname-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 "man/${pkgname}.1.gz" "${pkgdir}/usr/share/man/man1/${pkgname}.1.gz"
  install -Dm644 'reflector.service' "$pkgdir/usr/lib/systemd/system/reflector.service"
  install -Dm644 'reflector.timer' "$pkgdir/usr/lib/systemd/system/reflector.timer"
  install -Dm644 'reflector.conf' "$pkgdir/etc/xdg/reflector/reflector.conf"
}


# vim: set ts=2 sw=2 et:
